public class Classstudent implements Comparable{
    public String name;
    public int age;
    public Classstudent(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return name+":"+age;
    }

    @Override
    public int compareTo(Object o) {
        Classstudent c = (Classstudent)o;
        if(this.age > c.age) return 1;
        if(this.age < c.age) return -1;
        return 0;
    }
}
